package net.wanho.util;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import net.wanho.vo.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;

public class ExceptionUtil {
    /**
     * 处理全局Sentinel异常的方法
     * 该方法必须为static的
     */
    public static AjaxResult handlerException(String username, BlockException e){
        return AjaxResult.error("Sentinel限流，请稍后再试：" + e);
    }
}